package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
)

var (
	EsClient *elasticsearch.Client
)

func Init() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://117.27.231.169:9200",
		},
	}
	EsClient, err = elasticsearch.NewClient(cfg)
	if err != nil {
		panic(err)
	} else {
		fmt.Println("es连接成功")
	}

}
